#!/usr/bin/env perl
use strict;

use Carp;

BEGIN{
  push @INC, '../../..';
}

END{
}

use Phenyx::Database::DBEntry;
use InSilicoSpectro::InSilico::ModRes;

eval{
  Phenyx::Config::GlobalParam::readParam();
  InSilicoSpectro::InSilico::ModRes::init();

  my $e=Phenyx::Database::DBEntry->new({AC=>'myac',
				      sequence=>'MASLAALALSLLLRLQLPPLPGARAQSAPGGCSFDEHYSNCGYSVALGTNGFTWEQINTTEKPMLDQAVPTGSFMMVNSSGRASGQKAHLLLPTLKENDTHCIDFHYYFSSRDRSSPGAL
NVYVKVNGGPQGNPVWNVSGVVTEGWVKAELAISTFWPHFYQVIFESVSLKGHPGYIAVDEVRVLAHPCRKAPHFLRLQNVEVNVGQNATFQCIAGGKWSQHDKLWLQQWNGRDTALMVT
RVVNHRRFSATVSVADTAQRSVSKYRCVIRSDGGSGVSNYAELIVKEPPTPIAPPELLAVGATYLWIKPNANSIIGDGPIILKEVEYRTTTGTWAETHIVDSPNYKLWHLDPDVEYEIRV
LLTRPGEGGTGPPGAPLTTRTKCADPVHGPQNVEIVDIRARQLTLQWEPFGYAVTRCHSYNLTVQYQYVFNQQQYEAEEVIQTSSHYTLRGLRPFMTIRLRLLLSNPEGRMESEELVVQT
EEDVPGAVPLESIQGGPFEEKIYIQWKPPNETNGVITLYEINYKAVGSLDPSADLSSQRGKVFKLRNETHHLFVGLYPGTTYSFTIKASTAKGFGPPVTTRIATKISAPSMPEYDTDTPLNETDTTITVMLKPAQSRGAPVSVYQLVVKEERLQKSRRAADIIECFSVPVSYRNASSLDS
LHYFAAELKPANLPVTQPFTVGDNKTYNGY
WNPPLSPLKSYSIYFQALSKANGETKINCV
RLATKAPMGSAQVTPGTPLCLLTTGASTQNSNTVEPEKQVDNTVKMAGVIAGLLMFIIIL
LGVMLTIKRRRNAYSYSYYLSQR KLAKKQKETQSGA QREMGPVASADKPTTKLSASRNDE
GFSSSSQDVNGFTDGSRGELSQPTLTIQTHPYRTCDPVEMSYPRDQFQLAIRVADLLQHI
TQMKRGQGYGFKEEYEALPEGQTASWDTAKEDENRNKNRYGNIISYDHSRVRLLVLDGDP
HSDYINANYIDGYHRPRHYIATQGPMQETVKDFWRMIWQENSASIVMVTNLVEVGRVKCV
RYWPDDTEVYGDIKVTLIETEPLAEYVIRTFTVQKKGYHEIRELRLFHFTSWPDHGVPCY
ATGLLGFVRQVKFLNPPEAGPIVVHCSAGAGRTGCFIAIDTMLDMAENEGVVDIFNCVRE
LRAQRVNLVQTEEQYVFVHDAILEACLCGNTAIPVCEFRSLYYNISRLDPQTNSSQIKDE
FQTLNIVTPRVRPEDCSIGLLPRNHDKNRSMDVLPLDRCLPFLISVDGESSNYINAALMD
SHKQPAAFVVTQHPLPNTVADFWRLVFDYNCSSVVMLNEMDTAQFCMQYWPEKTSGCYGP
IQVEFVSADIDEDIIHRIFRICNMARPQDGYRIVQHLQYIGWPAYRDTPPSKRSLLKVVR
RLEKWQEQYDGREGRTVVHCLNGGGRSGTFCAICSVCEMIQQQNIIDVFHIVKTLRNNKS
NMVETLEQYKFVYEVALEYLSSF'
				     });
  my $mr=InSilicoSpectro::InSilico::ModRes::getFromDico('PHOS');
  $e->addModRes(2, $mr);
  $e->addModRes(10, $mr);
  $e->addModRes(134, $mr);
  $e->addModRes(800, $mr);

  $e->print();
  print "------------\n";


  $e->remove(3,725);
  $e->print();
  print "------------\n";

  my $e2=Phenyx::Database::DBEntry->new($e);
  $e2->insert(63, 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
  $e2->print();
  print "------------\n";
  $e->print();
  print "------------\n";
  $e->xtract(60,80);
  $e->print();
  print "------------\n";


};
if ($@){
  print STDERR "error trapped in main\n";
  carp $@;
}
print "version=".Phenyx::Database::DBEntry->getVersion()."\n";
 
